// import Vue from 'vue';
import Router from 'vue-router';

const Login = () => import('@/containers/Login/Login');
const Register = () => import('@/containers/Login/Register');
const HomeWrap = () => import('@/containers/HomeWrap');
const Square = () => import('@/containers/Square');
const ArticleDetail = () => import('@/containers/ArticleDetail');
const Quarter = () => import('@/containers/Quarter');

// Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/register',
      name: 'Register',
      component: Register,
    },
    {
      path: '/home',
      name: 'HomeWrap',
      component: HomeWrap,
      children: [
        {
          path: 'square',
          component: Square,
        },
        {
          path: 'quarter',
          component: Quarter,
        },
        {
          path: 'article/:id',
          component: ArticleDetail,
          props: true,
        },
      ],
    },
  ],
});
